package com.nervenets.shopping.hibernate.dao;

import com.nervenets.general.hibernate.dao.BaseDao;
import com.nervenets.shopping.hibernate.domain.shopping.Product;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface ProductDao extends BaseDao<Product> {
    @Modifying
    @Transactional
    @Query(value = "update Product SET saleCount = :count where id = :id ")
    void updateSaleCount(@Param("id") long id, @Param("count") long count);
}
